package ru.belokuriha_online.resort_hotels_belokuriha;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

public class Favorsql extends SQLiteOpenHelper
{
	private static final String dbname = "sfavorits.db";
	private static final int dversion = 1;
	public static final String dtable = "favorits";
	public static final String UID = "_id";
	public static final String DFAVORSAN = "dfavorsan";
	public static final String DFAVORCATEGORY = "dfavorcategory";
	public static final String DFAVORAREAN = "dfavorarean";
	public static final String DFAVORRAZM = "dfavorrazm";
	public static final String DFAVORTIME = "dfavortime";
	public static final String DFAVORFOOD = "dfavorfood";
	public static final String DFAVORPRICE = "dfavorprice";
	public static final String DFAVORPRIM = "dfavorprim";
	
	private static final String SQL_CREATE_T = "CREATE TABLE "
	+ dtable + " ("
	+ UID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
	+ DFAVORSAN + " text," + DFAVORCATEGORY + " text," + DFAVORAREAN + " text,"
	+ DFAVORRAZM + " text," + DFAVORTIME + " text," + DFAVORFOOD + " text," + DFAVORPRICE + " real," + DFAVORPRIM + " text" + ");";
	
	private static final String SQL_DROP = "DROP TABLE IF EXISTS " + dtable;

	public Favorsql(Context context)
	{
		super(context, dbname, null, dversion);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db)
	{
		// TODO Auto-generated method stub
		db.execSQL(SQL_CREATE_T);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		// TODO Auto-generated method stub
		//db.execSQL(SQL_DROP);
		//onCreate(db);
	}

}

